﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace OnlineMealOrdering.Extends
{
    public class CustomController : Controller
    {
        protected internal virtual JavaScriptResult JavaScript(string actionName,string controllerName)
        {
            string scrpit = string.Format("window.location.href='/{0}/{1}';", controllerName, actionName);
            return JavaScript(scrpit);
        }
        protected internal virtual JavaScriptResult JavaScriptShowMsg(string type,string title,string msg,string callback="")
        {
            string scrpit = string.Format("MessageShow('{0}','{1}','{2}');{3}", type, title, msg, string.IsNullOrWhiteSpace(callback)?"":callback+"();");
            return JavaScript(scrpit);
        }
    }
}